''' Mission 12 - Night Light With a function and constant ''' from codex import * ROOM = 15000 MAX_PERCENT = 20 def nightlight(value): scaled = (1 - value/ROOM) * MAX_PERCENT level = int(scaled) pixels.fill(WHITE, brightness = level) while True: value = light.read() if value < ROOM: nightlight(value) else: pixels.fill(BLACK)